package com.ejuornal.action;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import com.ejuornal.bean.Category;
import com.ejuornal.service.CategoryService;

public class CategoryAction extends BaseAction<Category>{
	private static final long serialVersionUID = 2150879010634400348L;
	private Category category;
	private List<Category> categorys;
	private CategoryService categoryService;
	private Map<String, Object> dataMap = new HashMap<String, Object>();
	
	
	public String find_all() {
		categorys = categoryService.findAll();
		dataMap.clear();
		dataMap.put("categorys", categorys);
		return SUCCESS;
	}
	
	public Map<String, Object> getDataMap() {
		return dataMap;
	}

	public void setDataMap(Map<String, Object> dataMap) {
		this.dataMap = dataMap;
	}

	
	
	public Category getCategory() {
		return category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	public List<Category> getCategorys() {
		return categorys;
	}

	public void setCategorys(List<Category> categorys) {
		this.categorys = categorys;
	}

	public CategoryService getCategoryService() {
		return categoryService;
	}
	@Resource(name="categoryService")
	public void setCategoryService(CategoryService categoryService) {
		this.categoryService = categoryService;
	}
}
